<include file="Public:header"/>
<style>
input{padding:5px}
</style>


<form method="POST" action="__URL__/updateShop" enctype="multipart/form-data">
<table border="0" width="100%" cellspacing="3" cellpadding="3">
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">商家名称：</td>
		<td><input type="text" name="name" size="20" value="{$shop.shop_name}">（必填）</td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137">
		<p align="right">特色域名：</td>
		<td><input type="text" name="domain" value="{$shop.domain}"><div id="tixing"></div></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">等级：</td>
		<td>
			<select size="1" name="level">
				<option value="1" <if condition="$shop.level eq 1">selected</if>>★</option>
				<option value="2" <if condition="$shop.level eq 2">selected</if>>★★</option>
				<option value="3" <if condition="$shop.level eq 3">selected</if>>★★★</option>
				<option value="4" <if condition="$shop.level eq 4">selected</if>>★★★★</option>
				<option value="5" <if condition="$shop.level eq 5">selected</if>>★★★★★</option>
			</select>
		</td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">简介：</td>
		<td><textarea rows="7" name="intro" cols="63">{$shop.shop_intro}</textarea></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">蚂蚁点评：</td>
		<td><textarea rows="7" name="review" cols="63">{$shop.review}</textarea></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">联系人：</td>
		<td><input type="text" name="user" size="20" value="{$shop.shop_user}"></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">地址：</td>
		<td><input type="text" name="address" size="20" value="{$shop.shop_address}"></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">电话：</td>
		<td><input type="text" name="tel" size="20" value="{$shop.shop_tel}"></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">有效期至：</td>
		<td><input type="text" name="end_time" size="20" <if condition="$shop.end_time gt 0"> value='{$shop.end_time|date="Y-m-d",###}'></if></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">店铺logo：</td>
		<td><input type="file" name="logo" size="20">
		<if condition="$shop.shop_logo neq ''"><a href="__APP__/weishop/logo/{$shop.shop_logo}" target="_blank"><img src="__APP__/weishop/logo/{$shop.shop_logo}" height=80></a>
		</if>
		</td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">店铺banner：</td>
		<td><input type="file" name="banner" size="20">
		<if condition="$shop.shop_banner neq ''"><a href="__APP__/weishop/logo/{$shop.shop_banner}" target="_blank"><img src="__APP__/weishop/logo/{$shop.shop_banner}" height=80></a>
		</if>
		</td>
	</tr>
</table>
<input type="text" name="shop_id" value="{$shop.shop_id}" style="display:none">
<br><br><br>
<div id="save"><input id="change" type="submit" value="保存更改"></div>
</form>

<script>
$(function(){
    $("[name=domain]").blur(function(){
	    var domain=$("[name=domain]").val();
		var shop_id = $("[name=shop_id]").val();
		if(domain != ''){
				$.get("__URL__/checkDomain",{domain:domain,shop_id:shop_id},function(res){
					var res = eval('(' +res+ ')');
					if(res.errno == 0){
						$("#tixing").html("<font color='green'>可以使用</font>");
					}else{
						$("[name=domain]").val('');
						$("#tixing").html("<font color='red'>已被占用</font>");
					}
				})
		}
	})

})
</script>
</body>
</html>